<!--
 * @Description:
 * @version:
 * @Author: 尹鹏孝
 * @Date: 2023-02-21 11:39:41
 * @LastEditors: 尹鹏孝
 * @LastEditTime: 2023-02-21 13:51:00
-->
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>grid布局</title>
    <style>
        *{
            padding:0;
            margin: 0;
        }
        body,html,.grid,.grid-container{
            height: 100%;
        }
        .grid-container{
            display: grid;
            grid: 'header header header header header header'
            'menu main main main right right'
            'menu footer footer footer footer footer';
            grid-gap:10px ;
            background-color: #2196f3;
            padding:10px;
        }
        .grid-container > div {
            background-color: rgba(255, 255, 255, 0.8);
            text-align: center;
            padding: 20px 0;
            font-size: 12px;
            }
        .item1{
            grid-area: header;
        }
        .item2{
            grid-area: menu;
        }
        .item3{
            grid-area: main;
        }
        .item4{
            grid-area: right;
        }
        .item5{
            grid-area: footer;
        }
    </style>
</head>
<body>
    <div class="grid">
        <div class="grid-container">
            <div class="item1">头部</div>
            <div class="item2">菜单</div>
            <div class="item3">主要内容区域</div>
            <div class="item4">右侧</div>
            <div class="item5">底部</div>
        </div>

    </div>
</body>
</html>